Release 10.1A: OpenEdge Development:
Progress 4GL Handbook


INDEX-INFORMATION attribute

This attribute allows you to retrieve information about the indexes Progress uses to retrieve the records that satisfy the selection criteria. There is also an INDEX-INFORMATION function for static queries, but the dynamic method is especially useful as part of a procedure that defines selection criteria at run time for either a statically defined or dynamic query. If there is variability in the WHERE clause your procedure accepts or generates at run time (perhaps based on a specific user request), the record retrieval might be highly inefficient if the query requires searching nonindexed field values for large tables. The INDEX-INFORMATION method takes a single INTEGER argument, which is the join level you want information for. For example, a value of 1 means that you want index information for the first table in the join.

If Progress is able to use one or more index brackets to satisfy the query so that it does not have to read all the records in a table, the method returns a comma-separated list of the indexes used. Progress uses more than one index to resolve a complex query if this results in the smallest number of nonindexed fields being searched.

If Progress is unable to use an index to reduce the number of records read because the selection involves nonindexed fields or fields that are not the primary components of a multi-component index, then it returns the "WHOLE-INDEX" string, followed by a comma, followed by the name of the index Progress uses to navigate the records. This is normally the primary index of the table.

You can use the INDEX-INFORMATION method to warn users of potentially inefficient queries or prevent them from executing queries that can’t use an index.

You must prepare the query before you can query its INDEX-INFORMATION.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095